package com.gict.antifraudback.exception;

import com.gict.antifraudback.enums.IResponseEnum;
import com.gict.antifraudback.result.ResultEnum;
import lombok.Getter;

/**
 * @Description: 自定义异常类
 **/
@Getter
public class MyException extends RuntimeException {

	private static final long serialVersionUID = 6265452301269221116L;

	private Object[] args;
	private ResultEnum resultEnum;
	private IResponseEnum responseEnum;

	public MyException(String msg) {
		super(msg);
		this.resultEnum=ResultEnum.CODE_2;
	}

    public MyException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.resultEnum=resultEnum;
    }

	public MyException(ResultEnum resultEnum, String msg) {
		super(msg);
		this.resultEnum = resultEnum;
	}

	public MyException(IResponseEnum responseEnum, String msg) {
		super(msg);
		this.responseEnum = responseEnum;
	}

	MyException(IResponseEnum responseEnum, Object[] args, String message) {
		super(message);
		this.responseEnum = responseEnum;
		this.args = args;
	}

	MyException(IResponseEnum responseEnum, Object[] args, String message, Throwable cause) {
		super(message, cause);
		this.responseEnum = responseEnum;
		this.args = args;
	}
}
